import axios from "@/api/axios";

export default {
  // 入库单分页查询
  queryPageByConditionWarehouseOrder(params) {
    return axios.post(`/v3/warehouse/warehousingOrder/queryPageByCondition`, {
      ...params,
      organizationNo: sessionStorage.organizationNo
    })
  },
  // 添加入库单
  addWarehousingOrder(params) {
    return axios.post(`/v3/warehouse/warehousingOrder/add`, {
      ...params
    })
  },
  // 修改入库单
  editWarehousingOrder(params) {
    return axios.post(`/v3/warehouse/warehousingOrder/edit`, {
      ...params
    })
  },
  // 批量删除
  delWarehousingOrder(no) {
    return axios.get(`/v3/warehouse/warehousingOrder/delByNo?no=${no}`)
  },
  // 入库单条件查询
  queryByConditionWarehouseOrder(params) {
    return axios.post(`/v3/warehouse/warehousingOrder/queryByCondition`, {
      ...params,
      organizationNo: sessionStorage.organizationNo
    })
  },
  // 入库货物查询
  getWarehousingGoodsByNo(no) {
    return axios.post(`/v3/warehouse/warehousingGoods/queryByCondition`, {
      warehousingOrderNo: no
    })
  },
  // 查看入库图片
  getWarehousingPicture(pictureNo) {
    return axios.get(`/v3/warehouse/warehousingPicture/queryByNo?no=${pictureNo}`)
  },
  delWarehousingPicture(pictureNo) {
    return axios.get(`/v3/warehouse/warehousingPicture/delByNo?no=${pictureNo}`)
  },

  // 出库单分页查询
  queryPageByConditionOutboundOrder(params) {
    return axios.post(`/v3/warehouse/outboundOrder/queryPageByCondition`, {
      ...params,
      organizationNo: sessionStorage.organizationNo
    })
  },
  // 添加出库单
  addOutboundOrder(params) {
    return axios.post(`/v3/warehouse/outboundOrder/add`, {
      ...params
    })
  },
  // 销售出库批量删除
  delboundOrder(no) {
    return axios.get(`/v3/warehouse/outboundOrder/delByNo?no=${no}`)
  },
  // 出库单条件查询
  queryByConditionOutboundOrder(params) {
    return axios.post(`/v3/warehouse/outboundOrder/queryByCondition`, {
      ...params,
      organizationNo: sessionStorage.organizationNo
    })
  },
  // 出库货物查询
  getOutboundGoodsByNo(no) {
    return axios.post(`/v3/warehouse/outboundGoods/queryByCondition`, {
      outboundOrderNo: no
    })
  },
  // // 查看出库图片
  // getOutboundOrderPicture(pictureNo){
  //   return axios.get(`/v3/warehouse/warehousingPicture/queryByNo?no=${pictureNo}`)
  // },
  // delOutboundOrderPicture(pictureNo){
  //   return axios.get(`/v3/warehouse/warehousingPicture/delByNo?no=${pictureNo}`)
  // },

  // 退货分页查询
  queryPageByConditionReturnOrder(params) {
    return axios.post(`/v3/warehouse/returnOrder/queryPageByCondition`, {
      ...params,
      organizationNo: sessionStorage.organizationNo
    })
  },
  // 添加入库单
  addReturnOrder(params) {
    return axios.post(`/v3/warehouse/returnOrder/add`, {
      ...params
    })
  },
  // 批量删除
  delReturnOrder(no) {
    return axios.get(`/v3/warehouse/returnOrder/delByNo?no=${no}`)
  },
  // 查看出库图片
  getReturnOrderPicture(pictureNo) {
    return axios.get(`/v3/warehouse/returnOrderPicture/queryByNo?no=${pictureNo}`)
  },
  delReturnOrderPicture(pictureNo) {
    return axios.get(`/v3/warehouse/returnOrderPicture/delByNo?no=${pictureNo}`)
  },
  // 退货货物查询
  getReturnGoodsByNo(no) {
    return axios.post(`/v3/warehouse/returnOrderGood/queryByCondition`, {
      returnOrderNo: no
    })
  }
}
